package com.work03.dao;

import com.work03.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 绛河
 */
@Mapper
public interface OrderMapper {

    /**
     * 新增订单
     * @param order
     */
    @Insert("INSERT INTO t_order(id, order_no, price, customer_id) VALUES(null,#{orderNo}, #{price}, #{customer.id})")
    void insert(Order order);

    /**
     * 查询所有订单
     * @return
     */
    List<Order> selectOrders();
}